﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Shove.Web.UI;

public partial class UserControls_PictureBottom : UCBase
{
    public UserControls_PictureBottom()
    {
        Name = "底部广告图";

        swpas = new ShoveWebPartAttribute[3];

        swpas[0] = new ShoveWebPartAttribute_Int("图片宽度", "1,400", 550, "新品图片宽度");
        swpas[1] = new ShoveWebPartAttribute_Int("图片高度", "1,400", 84, "新品图片高度");
        swpas[2] = new ShoveWebPartAttribute_Image("图片URL", "", "../images/flash_banner/bottom.jpg", "图片的URL地址");
    }

    private void InitLayout()
    {
        imgBg.Width = Shove._Convert.StrToInt(swpAttributes[0], 0);
        imgBg.Height = Shove._Convert.StrToInt(swpAttributes[1], 0);
        imgBg.ImageUrl = swpAttributes[2];        
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitLayout();
        }
    }

    protected void imgBg_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            string URL = new DAL.Tables.tbl_Site_TemplatesFile().Open("", "[FileName] = 'bottom.jpg'", "").Rows[0]["Links"].ToString();
            Response.Redirect(URL);
        }
        catch { }
    }
}